Repository navigation
feat: dApp Store readiness, keyed rate limits, security-audit fixes and Next.js 16.4.3 - #18
Merged
Merged
Conversation
The advisory (critical, published 2026-09-30) is remote code execution in the Node.js `ImageResponse` from `next/og` when attacker-controlled values reach SVG content, attributes or styles. This app does not import `next/og` or `ImageResponse`, so it was not exploitable, but `npm audit --omit=dev` reported it as critical. 16.3.8 is the newest 16.3 patch release; eslint-config-next moves with it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
The Solana dApp Store Publisher Policy requires in-app account deletion. Vercel holds no service-role key, so a new security definer function, public.delete_own_account(), deletes auth.users where id = auth.uid() and every owner-keyed row cascades with it. It takes no argument, pins an empty search_path and is executable by authenticated only. My reports gains a Delete account section with an in-page confirmation. The client calls the RPC with the confirmed session only, then clears the account's device alert settings and signs out. Failures say whether anything was deleted, and a retry is safe. Tests: PGlite checks the cascade across all six owner-keyed tables, owner isolation and that anon, service_role and a forged anon subject cannot call it; unit tests cover the client flow; Playwright covers the dialog with mocked Auth and PostgREST. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…ion accurately Adds public /privacy and /terms pages for Operator Uplift, built from what the code does: Supabase accounts, saved reports, alert rules, destinations, events and deliveries, hashed-IP rate limiting, the read-only wallet connection, processors, retention, account deletion, security and the 18+ requirement. The terms carry the Solana dApp Store Developer Agreement 10.6 clause, the not-advice and estimate limits, the alert caveat, no warranty and limitation of liability. Both pages are linked from the landing footer, the workspace navigation and footer, the sign-in page and the sitemap. Contact uses NEXT_PUBLIC_SUPPORT_EMAIL when set and the GitHub issue tracker otherwise. The landing hero, FAQ and privacy section, docs/PROVIDER.md and docs/DESCRIPTION.md now describe the optional read-only wallet connection and the Android app instead of claiming there is no wallet connection. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
… build androidResources.localeFilters keeps English resources only, and a values-en string set declares English explicitly. aapt2 dump badging now reports `locales: '--_--' 'en'` (2 entries) instead of 86, so the store no longer reads 85 translated locales the app does not support. docs/seeker-and-pwa.md now gives the Gradle signing route that the build actually reads, warns that a missing signing value silently produces an unsigned APK, replaces the /rwa deep-link example with a real /app link and updates the Publisher Portal facts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…al pages The longer read-only note wraps on phones; it now flows inline so the check mark stays on its first line. Both legal pages use a shared "Buffer · Legal" eyebrow instead of repeating the title, and the deletion check only requires the migration to sort after the alert migrations, so later migrations do not break it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
docs/dapp-store/listing.md holds the Portal text (name, subtitle and description with character counts, What's new, URLs, reviewer notes that name the real Delete account controls) and a submit checklist. The 1200x600 banner is composed in scripts/dapp-store/banner.html from the brand masters and rendered at deviceScaleFactor 1; its scenario card is the app's own Long + short preset. Six 1080x1920 screenshots were captured from a local production build of this branch reading live mainnet data, so the landing shot shows the corrected hero line. scripts/generate-dapp-store-assets.mjs regenerates the banner and screenshots (--base-url for any build) and verifies real PNG sizes, file sizes, text limits and that every listed screenshot exists. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
These projects are not entered in Solana Mobile × RadiantsDAO CLOCK IN, so the store guide no longer frames the listing as a prize requirement or keeps the hackathon checklist. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
Read-only checks on production found two privacy defects in the hosted limiter. Nothing called private.prune_rate_limits(), so counters from 17 September were still stored. Each key was the server's unkeyed SHA-256 of the client IP, which brute force reverses for IPv4. 20261008120000_rate_limit_retention_and_keyed_hash.sql keeps the consume_rate_limit signature, result and secret, but stores HMAC-SHA-256 of the sent key under a random 32-byte key in private.rate_limit_hash_key (RLS on, no grants to anon, authenticated or service_role). The limiter is SECURITY DEFINER with an empty search_path. Every check deletes expired counters, and where pg_cron is installed (it is on the hosted project) buffer-prune-rate-limits runs every three minutes. Windows over one minute are refused, so no counter outlives the last request by more than four minutes. The migration deletes every counter stored under the old hash, records the limiter's tables for fresh projects, revokes EXECUTE from browser roles and service_role, and grants it back to anon only. It also requires a configured secret: the hosted check passed any secret when the config row was missing. The server keeps sending a digest, never an IP, so the migration is safe before or after the app deploys. rate-limit.ts gets its first unit tests, pinning that contract and the per-process fallback. scripts/verify-rate-limit.mjs (82 assertions, in CI) checks the migration against the hosted pre-migration definitions and an empty project, applied as a non-superuser owner. The account-deletion verifier now loads pgcrypto, as Supabase does, because it applies every migration. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…olicy The rate-limiting section said counters keep a one-way SHA-256 hash of the IP and gave no retention period. It now says they hold an HMAC-SHA-256 under a random key that never leaves the database, and that each counter is deleted when its one-minute window ends, at the next check or by a cleanup every three minutes, so none is kept more than five minutes after the last request. The retention list says the same. No other legal text changes, and the browser spec checks the new wording on desktop and mobile. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
5 tasks
The policy promises a new date whenever it changes, and this PR changes how rate-limit counters are hashed and kept. The terms page shares the date. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…ckup The dApp Store clause now names the Solana Mobile Parties, says they are not a party to these terms and have no responsibility or liability to the user, and extends the No warranty and Limitation of liability sections to them, as section 10.6 of the Solana dApp Store Developer Agreement requires. The e2e spec asserts the new sentences. The Android shell no longer allows backup, so the WebView's session cookie and local storage are not copied to Google or to a new phone. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…store branch Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…loads, stop mixed content The Web Shell template handed every link to startActivity without a catch, so a phone with no wallet or mail app closed the app the moment Use my wallet or a support link was tapped, and intent: URLs were started with their component intact. Downloads were dropped entirely, so the JSON and CSV exports did nothing on a Seeker. - LinkOpener catches every launch and shows a short message instead of crashing. intent: URLs lose component, selector, extras and URI grants and must be BROWSABLE. Only https, mailto, solana-wallet and intent leave the shell; everything else is blocked. - WebShellDownloads saves https downloads through DownloadManager and blob: and data: downloads through a two-method page bridge that only creates new files under Downloads. - Mixed content is never allowed (localhost stays a secure context for Mobile Wallet Adapter), third-party cookies and file or content access are off, and popups need a user gesture. - Backup and data-extraction rules exclude everything explicitly instead of the template stubs. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…retention) into the store branch Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
The hosted project recorded six of the checked-in migrations under the versions at which they were applied, while the files carried local timestamps, so every ledger comparison showed six local-only and six remote-only entries for the same bodies. The files are renamed with git mv to the ledger versions (contents untouched) and every reference in scripts/ and docs/ follows: 20260915120000 -> 20260915180735 create_alert_pipeline 20260919090000 -> 20260919172720 harden_alert_pipeline 20260920010000 -> 20260919173121 harden_function_permissions 20260920020000 -> 20260919183521 hosted_monitoring 20260928120000 -> 20260928154216 liquidation_sentinels 20261007120000 -> 20261008081817 delete_own_account Three migrations existed only in production (the pg_net scheduler preparation, the synchronous http 1.6 trigger and the delivered-acknowledgement helper). Their bodies are checked in byte for byte under their ledger versions. They need pg_cron, Vault and the http extension, which PGlite lacks, so verify-account-deletion.mjs, the one script that applies every migration in order, skips exactly those three by name and asserts they are present. docs/DATABASE-VERIFICATION.md carries a dated note. Nothing was applied or changed on the hosted project. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…hecks apart
claim_check ordered due rules "next_check nulls first", and every rule edit
resets next_check to null (guard_alert_rule). The scheduled worker drains one
rule a minute, so an owner who edited a rule each minute was always first and
another owner's due rule was never checked. A manual check from
POST /api/monitoring/rules/{id}/check also took the single global 45-second
lease, so repeated manual checks could keep the scheduled tick from claiming
anything, and nothing bounded manual checks beyond 30 a minute.
20261017103000_worker_fairness.sql replaces buffer_monitor_worker (same
signature, same anon-only grant, every other action unchanged):
- claim_check serves the owner whose rules were attempted least recently
first, then the longest-due rule by coalesce(next_check, created_at), and
claims at most one rule per owner per minute, whoever asked.
- Scheduled and manual checks hold separate leases (new nullable column
alert_rules.check_lease_kind). The tick is blocked only by another scheduled
lease; a manual check is blocked only by that owner's own manual lease; both
still respect each rule's lease. A claim naming only the rule is scoped to
the rule's owner, so the existing contract keeps working.
- start refuses more than 60 manual checks per owner per hour, in addition to
the 30 per minute.
scripts/verify-hosted-monitoring.mjs proves it: owner A edits a rule every
minute for four cycles and the tick serves A, B, A, B; the tick claims B's rule
while A's manual check is in flight; manual leases are per owner; the hourly
cap throttles the 61st manual check. The CHECK_NOT_DUE message and
docs/ALERTS.md describe the new limits. Applying the one-claim-per-owner-per-
minute rule to manual checks as well is a product decision taken on the safe
side: it bounds provider reads per owner and the hourly cap is a second,
independent bound.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…rker after ten a minute public.buffer_monitor_worker is callable with the publishable key by design; the secret in p_secret is its only gate, and before this change a caller could try values without limit and nothing was logged. 20261019090000_worker_secret_lockout.sql replaces the function (same signature, same anon-only grant, the fairness changes kept). Failed attempts are counted per calendar minute; after 10 in one minute every call, a correct one included, is refused with 'Worker authentication paused' until the minute ends, before any secret is compared. Every failure and every refusal raises a WARNING in the PostgreSQL log carrying the count only, never the attempted value. The count lives in a sequence in the private schema, not a table: the failing call must still end in the 42501 exception the server relies on, and that exception rolls back any row the call wrote, while sequence state is non-transactional. The value is minute*1000+failures; the sequence is revoked from anon, authenticated and service_role like the private tables. scripts/verify-hosted-monitoring.mjs proves the count survives each failure, the pause refuses the right secret for the rest of the minute, refusals are not counted, a new minute starts fresh, the warnings name the count and never the secret, and browser roles cannot read or write the sequence. docs/ALERTS.md states the 32-random-character minimum, how to generate and rotate the secret, and that an attacker with the publishable key can pause the worker for the rest of a minute by failing ten times, which was accepted over unbounded guessing. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…ing, cache identical reads serveRead kept a per-instance window of 60 reads a minute and 4 in flight next to the per-client limit of 30, so two clients reading steadily could exhaust an instance for everyone, and every tap on Explore live risk was a new provider read that counted against both budgets. src/server/live-read-budget.ts now owns the budget, applied after validation: - A five-second cache keyed by a SHA-256 digest of the normalised request (kind, protocol, network, authority, subaccount). Identical reads, concurrent ones included, share one provider call and consume no budget; failed reads are not cached. No address is retained. - The per-client limit is the primary control: 30 reads a minute per client, counted in the shared store when it is configured and in a bounded local window per client digest when it is not. - The per-instance ceiling is 240 reads a minute and 8 in flight, which no two clients can reach on their own. ProviderFailure moves to src/server/provider-failure.ts so the budget module and boundary.ts share it without a cycle; boundary.ts re-exports it for the existing importers. tests/live-read-budget.test.ts covers the cache window and sharing, uncached failures, both per-client paths, the instance ceiling, the in-flight cap and serveRead end to end; the provider tests reset the shared budget between cases. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…atabase public.saved_reports accepted any number of rows of up to 256 KiB each. The app lists the newest 50 and its sign-up form is gated, but the Auth API accepts sign-ups regardless, so one account could fill the database. 20261019091500_saved_report_quota.sql adds a BEFORE INSERT trigger that counts the account's rows and bytes under a per-account advisory lock (so concurrent inserts cannot pass the count together) and refuses the 51st report or the byte past 8 MiB with SQLSTATE 54000 and a fixed hint. Existing rows are untouched; an account over a limit keeps its reports and can delete to make room. The trigger function lives in the private schema with EXECUTE revoked from browser roles; triggers fire regardless. The app matches the code (isSavedReportQuotaError) and tells the person the library is full, without marking the write uncertain, since nothing was written. scripts/verify-saved-report-quota.mjs proves both caps as the real authenticated role under RLS, that other accounts are unaffected, that deletion makes room, that the per-report CHECK still applies, and that browser roles cannot run the function; CI runs it with the other verifiers. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…channels that exist The privacy policy said Velocity devnet reads use Solana's public devnet RPC, which is false when SOLANA_DEVNET_RPC_URL is set, and it promised "a private way" to handle deletion and other requests while forbidding personal data in public issues, a channel that exists only when NEXT_PUBLIC_SUPPORT_EMAIL is configured. - LEGAL_UPDATED is '24 October 2026' and LEGAL_UPDATED_ISO '2026-10-24' (shared by the privacy policy and the terms); the unit and e2e assertions follow. - The devnet sentence names SOLANA_DEVNET_RPC_URL and is true either way. - The deletion, rights and contact sections branch on supportContact(): with an email configured it is named as the private channel; without one the page says that deletion is the app's own Delete account control, that Buffer has no private support address at the moment, and that public issues must never carry personal details. No private way is promised. - The sitemap already lists /privacy and /terms (tests/legal.test.ts covers it); nothing to change there. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…cript imports scripts/generate-dapp-store-assets.mjs imports sharp and rolldown, but neither was declared: sharp was present only as an optional transitive dependency of Next.js and rolldown only as a peer of vitest, so a fresh install with a different resolution could leave the script without them. Both are now exact devDependencies at the versions already in the lockfile (sharp 0.35.5, rolldown 1.2.8). The lockfile changes only the two root entries and the dev/optional flags of those packages and their platform binaries; no version changed and node_modules was already up to date. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…ase origin and HMAC destination fingerprints src/server/rate-limit.ts posted RATE_LIMIT_SECRET to whatever NEXT_PUBLIC_SUPABASE_URL named. It now accepts only an https *.supabase.co origin without credentials, query or fragment, the same pin src/server/monitoring/repository.ts applies, and posts to that origin; any other value leaves the shared limiter off and the local windows apply, so the secret can never reach another host. Discord and webhook destination fingerprints were unkeyed SHA-256 digests over fields that include the destination token or secret. Owners see fingerprints in their monitoring status, so one could be brute-forced offline against the other, mostly known, fields. Both adapters now compute HMAC-SHA256 keyed with BUFFER_ALERT_WORKER_SECRET (the fingerprintKey option in tests) over the same fields, and refuse to describe destinations when that key is missing or shorter than 32 characters. Rotating any field or the worker secret changes the fingerprint, which pauses the bound rules until the destination is re-verified; the docs describe that and the rotation steps. Production has no registered destinations, so no stored fingerprint needs a migration; the first registration will be an HMAC. Tests cover rejected hosts never receiving the secret, origin normalisation, the exact HMAC, key rotation and the missing-key refusal. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
…t one hour The signed-webhook adapter accepted only a bare seconds value in Retry-After on a 429. An HTTP-date, which RFC 9110 allows and some receivers send, or any value over an hour, was treated as a permanent failure (INVALID_RETRY_AFTER), so a receiver asking for a longer pause lost the event for good. parseRetryAfterMs reads delay seconds or an IMF-fixdate HTTP-date relative to the adapter clock, caps both at one hour, and returns null for an absent or unreadable header; retryAfter then schedules an ordinary retry (about thirty seconds for null) with the existing floor and jitter, and never a permanent failure. The outcome table in docs/WEBHOOK-ALERTS.md says so. Tests cover both forms, a date already past, the cap on each form, unreadable headers including obsolete date formats, and the parser's edge values. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
A second Next.js advisory published after 16.3.8 is fixed in 16.4.3. The other direct dependencies named by npm audit move to their patched releases where the fix stays within the current major; what remains is either the React Native chain that Mobile Wallet Adapter pulls in or has no patched release yet. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
1 of 3 tasks
Patches the @vitest/mocker advisory that Dependabot opened grouped PRs for; test runner only, nothing shipped to users changes. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
Lighthouse's mobile legibility audit found most text on the app route below 12 px CSS (notes, hints, footnotes and labels at 8 to 11 px), which is small on a 6-inch phone. Running text moves to 12 px and kickers, badges and compact labels to 11 px; nothing is lowered. Measured on the built app at 390 px: 82.1% of text is now 12 px or larger, up from 21.5%. The muted text colour moves from #65736e to #5a6863, which lifts the scenario result labels from 4.41:1 to 5.2:1 against the panel background. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR ships
Everything Buffer needs for its Solana dApp Store listing, plus the fixes from the 16 October 2026 security audit, in one branch.
Store readiness (the original scope): privacy and terms pages that meet Developer Agreement §10.6, in-app account deletion through
delete_own_account(applied in production on 2026-10-08), an English-only Android shell, and the listing kit underdocs/dapp-store/.Android shell hardening (
android/): every external launch is guarded, so a phone without a wallet or mail app shows a short message instead of closing the app;intent:URLs lose component, selector, extras and URI grants and must be BROWSABLE; downloads work (DownloadManager for https, a two-method page bridge forblob:anddata:); mixed content is never allowed, third-party cookies and file access are off, popups need a user gesture, and the backup rules exclude everything.Rate limiter (folds in #19): HMAC-keyed hashes in the database, counters pruned every 3 minutes, privacy wording to match.
Security audit fixes
*.supabase.coorigin; destination fingerprints are HMACs under the worker secret.Dependencies: Next.js 16.4.3 (folds in #17); follow-redirects and vite patched by
npm audit fix. Remaining: the React Native chain pulled in by Mobile Wallet Adapter (never bundled) and the web3.js 1.x chain under the Velocity SDK, which needs a major upgrade.Database changes, in order, after this deploys
supabase/migrations/20261008120000_rate_limit_retention_and_keyed_hash.sqlsupabase/migrations/20261017103000_worker_fairness.sqlsupabase/migrations/20261019090000_worker_secret_lockout.sqlsupabase/migrations/20261019091500_saved_report_quota.sqlEach has a PGlite verifier under
scripts/. Afterwardssupabase migration listshould show no local-only or remote-only rows.Environment
No new variables.
BUFFER_ALERT_WORKER_SECRETmust be 32 or more random characters; it now also keys destination fingerprints, so rotating it re-verifies destinations.Verification
npm run typecheck,npm run lint,npm test(673 tests) and the six PGlite verifiers (alert schema, hosted monitoring, scheduler, account deletion, rate limit, saved-report quota) pass;npm run buildpasses on Next.js 16.4.3; the Android shell compiles as an unsigned release build; CI runs the e2e specs.Supersedes
#17 (Next.js upgrade) and #19 (keyed rate limits), both folded in.
Addendum, 25 October 2026
🤖 Generated with Claude Code
https://claude.ai/code/session_01JHDgeGLvKoi7gnFqUbJ1sw